function visible() {
    var v = $('#content').style;
    if (v.display == "block") {
        v.display = "none";
        $('#status').innerText = '-';
    } else {
        v.display = "block";
        $('#status').innerText = '+';
    }
}
// 展开
function spread(nod) {
    var v = "t" + nod;
    document.getElementById(v).style.display = "block";
    show();
}
var n = 1;
function show() {
    if (n <= 6) {
        setTimeout("spread(" + n + ")", 150);
        n++;
    } else {
        $('#status').innerText = '+';
        n = 1;
    }
}
// 收缩
function pinch(nod) {
    var v = "t" + nod;
    document.getElementById(v).style.display = "none";
    hide();
}
var y = 6;
function hide() {
    if (y >= 1) {
        setTimeout("pinch(" + y + ")", 150);
        y--;
    } else {
        $('#status').innerText = '-';
        y = 6;
    }
}

function control() {
    var v = $('#status').innerText;
    if (v == "-") {
        show();
    } else {
        hide();
    }
}

function repImg() {
    var img = $("#vimg");
    img.src = img.src + "?time=" + new Date();
}
var nameexist = true;
function onsubmit() {
    document.forms[0].submit();
}
function validatename() {
    var username = $("#name").val();
    if ($.trim(username) == "") {
        $("#nameinfo").html("账号不能为空!").css("color", "red").css("font-size",
                "12px").css("padding", "8px");
        return false;
    } else {
        $.get("/register.do?method=validateName", {
            name :username
        }, function(data) {
            if (data == "true") {
                $("#nameinfo").html("√").css("color", "green").css("font-size",
                        "12px").css("padding", "8px");
            } else {
                $("#nameinfo").html("对不起，您的账号已存在!").css("color", "red").css(
                        "font-size", "12px").css("padding", "8px");
                return false;
            }
        });
    }
}